package com.zijie.members.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zijie.members.model.Members;
import com.zijie.members.model.MembersAddress;
import com.zijie.members.model.search.MemberSearchBean;
import org.apache.ibatis.annotations.*;

@Mapper
public interface MemberMapper extends BaseMapper<Members> {

    //更新会员的锁定状态：
    @Update("update member SET enabled= #{enabled} WHERE id = #{id}")
    boolean update(Integer id, Boolean enabled);

    Page<Members> findAll(Page<Members> page, MemberSearchBean memberSearchBean);

    @Select("select id,account,password,name,pinyin,wechat,email,created_time,updated_time,created_by,updated_by from member where phone = #{phone}")
    Members findByPhone(String phone);
}